import React, { Component } from 'react';
import { Redirect, Route, Switch } from "react-router-dom";
import ProductHome from './home';
import ProductDetail from './detail';
import Save from './save';
import './product.less';

/**
 * 产品
 */
class Product extends Component {
    constructor(props) {
        super(props);
        this.state = {};
    }
    render() { 
        return (
           <Switch>
               {/* exact  精确匹配 */}
               <Route path='/product' component={ProductHome} exact />
               <Route path='/product/save' component={Save} />
               <Route path='/product/detail' component={ProductDetail} />
               <Redirect to='/product' />
           </Switch>
        );
    }
}
 
export default Product;